-
Notifications
You must be signed in to change notification settings - Fork 140
Makefile: targeted workaround for s390x builds on c10s #1674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds a workaround for s390x builds on CentOS 10 by setting the MALLOC_MMAP_MAX_
environment variable for cargo build
. The implementation has a critical bug in how it retrieves OS information, and can also be improved for portability and readability. My review provides a corrected and simplified version of the logic.
Signed-off-by: John Eckersberg <[email protected]>
91f7de1
to
4d45502
Compare
Actually I don't think this is going to help things in CI because IIUC packit is using the spec under contrib/packaging and that calls cargo directly instead of building via the Makefile. |
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a targeted workaround for s390x builds on CentOS Stream 10 by setting the MALLOC_MMAP_MAX_
environment variable. The change is applied to both the Makefile
for local builds and the bootc.spec
file for RPM builds. The changes are clear and address the issue described. I have one suggestion for the Makefile
to improve maintainability by reducing code duplication.
contrib/packaging/bootc.spec
Outdated
%if %new_cargo_macros | ||
%cargo_build %{?with_rhsm:-f rhsm} | ||
%bootc_cargo_build %{?with_rhsm:-f rhsm} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems somehow simpler to do this in shell script just above like
if test $(arch) = s390x; then
export MALLOC_MMAP_MAX_=0
fi
or so?
Us having our own cargo macros feels like overkill.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's better. I really hate bash scripting, and I really hate rpm macros, and any time I have to combine the two (and/or Makefiles...) it usually ends poorly 😆
That said though, since other things are broken by this today, if that's a valid workaround, why not just ask the toolchain maintainers to ship it by default? |
From the Jira it seems like the confidence is not particularly high on the workaround, but if we could provide early feedback on whether it helps in our case it would be quite useful to them. |
I'm going to let this round of copr builds run before I make any more changes just to see how things turn out. |
3b8a3c3
to
1b6e856
Compare
|
||
%build | ||
# https://issues.redhat.com/browse/RHEL-116881 | ||
%if 0%{?rhel} >= 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't this happening on c9s too? I suspect it has to do with the rust version, not the host OS version.
It seems simpler to just unconditionally do it on s390x anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@henrywang mentioned it happening on c9s but I haven't seen it happen yet in our CI, I figured I would be more conservative at first and if we start to see it showing up on 9 we can add it.
If it's not broken on Fedora for example I'd rather not enable the workaround there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OH, sorry, my bad @jeckersb. It's CS10, not CS9. CS9 is empty my brain. Sorry about that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Less broken things = better!
Signed-off-by: John Eckersberg <[email protected]>
1b6e856
to
64651dd
Compare
Hm looks like the change worked, but it still segfaulted even with the environment variable added Relevant (trimmed) bits:
|
Marking draft since this isn't yet doing what we want and it's not clear to me that it's really a good idea to work around it only here. |
Hi @jeckersb, the latest cs10 s390x build is passed. https://dashboard.packit.dev/jobs/copr/2855430 |
Signed-off-by: John Eckersberg [email protected]